package br.ufrj.dcc.smarthotel.activities;

import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import br.ufrj.dcc.smarthotel.R;
import br.ufrj.dcc.smarthotel.controls.SmartHotelControl;
import br.ufrj.dcc.smarthotel.listeners.SmartHotelListener;

public class SmartHotelActivity extends AppActivity {
	private Button loginButton;
	private TextView textViewSignUp;
	private SmartHotelListener listener;
	private EditText txtEmail;
	private EditText txtPassword;
	private SmartHotelControl control;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);
        
        this.findAllViews();
        this.control = new SmartHotelControl(this);
        
        this.listener = new SmartHotelListener(this);
        
        this.textViewSignUp.setOnClickListener(this.listener);
        this.loginButton.setOnClickListener(this.listener);
    }
    
    public void Login() {
    	this.control.Login();
    }
    
    private void findAllViews() {
    	this.loginButton = (Button) findViewById(R.id.btnSubmit);
    	this.textViewSignUp = (TextView) findViewById(R.id.txtSignUp);
    	this.txtEmail = (EditText) findViewById(R.id.txtEmail);
    	this.txtPassword = (EditText) findViewById(R.id.txtPassword);
    }
    
    public String getEmail() {
		return this.txtEmail.getText().toString().trim();
	}

	public String getPassword() {
		return this.txtPassword.getText().toString().trim();
	}
}